# -*- coding: utf-8 -*-
"""
@Time ： 2024/9/14 21:10
@Auth ： 九问
@File ：urls.py
@IDE ：PyCharm
@Email : 2750826557@qq.com
"""
from django.urls import path
from rest_framework.routers import DefaultRouter

from .views import *

urlpatterns = [
    path("code/", GetRegisterCodeGenericViewSet.as_view({"post": "create"})),
    path("logcode/<uuid:uuid>/", GetLoginCodeGenericViewSet.as_view({"get": "retrieve"})),
    path("register/", RegisterGenericViewSet.as_view({"post": "create"})),
    path('login/', LoginGenericViewSet.as_view()),
    path('api/token/', TokenObtainPairView.as_view(), name='token_obtain_pair'),  # jwtToken获取
    path('send-friend-request/<int:receiver_id>/', SendFriendRequestView.as_view(), name='send-friend-request'),
    path('accept-friend-request/<int:request_id>/', AcceptFriendRequestView.as_view(), name='accept-friend-request'),
    path('reject-friend-request/<int:request_id>/', RejectFriendRequestView.as_view(), name='reject-friend-request'),
    path('delete-friend/<int:friend_id>/', DeleteFriendView.as_view(), name='delete-friend'),
    path('api/is_friend/<int:user_id>/', IsFriendView.as_view(), name='is_friend'),
    path('friend-request-status/<int:user_id>/',FriendRequestStatusView.as_view(),name="friend-request-status"),
    path('friends/', FriendListView.as_view(), name='friend-list'),
    path('friend-requests/pending/', PendingFriendRequestsView.as_view(), name='pending-friend-requests'),
    path('userdetail/<int:user_id>/', UserDetailView.as_view(), name='user_detail'),
]
router = DefaultRouter()
router.register('group', GroupViewSet)
router.register("user", UserViewSet)
urlpatterns += router.urls
